<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean"%> 
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    
    <title><bean:message key="initialize"/> &nbsp;<bean:message key="project"/></title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<LINK href="../styles/stylewang.css"  type=text/css rel=stylesheet>
	<LINK href="../styles/sciencee.css"  type=text/css rel=stylesheet>
	<script language="javaScript" src="../js/calendar.js"></script>
	<script language=javascript>
		var hasEps = 1;
		var hasScene = 1;
		function setHasEsp(){
			showImg();
			ESPform.location.href="ESPform.jsp";
		}
		function setHasScence(){
			showImg();
			ESPform.location.href="ESPform.jsp";
			
		}
		function toName(){
			var a=document.getElementById("projectShortName").value;
			var b=document.getElementById("espName").value;
			var c=document.getElementById("scenceName").value;
			var d=document.getElementById("shotName").value;
			document.getElementById("allName").value=a+b+c+d;
		}
		function allSubmit(){
			var a=ESPform.window.getEsps();
			var b=ESPform.window.getScences();
			var c=ESPform.window.getShots();
			document.getElementById("espResult").value=a;
			document.getElementById("scenceResult").value=b;
			document.getElementById("shotResult").value=c;
		//	alert(document.getElementById("espResult").value);
		//	alert(document.getElementById("scenceResult").value);
		//	alert(document.getElementById("shotResult").value);
		
			document.forms[0].submit();
		}
		
		function showImg(){
			var hasE=document.getElementById("hasEspCheck");
			var hasS=document.getElementById("hasScenceCheck");
			var ss=document.getElementById("singleShot");
			var cs=document.getElementById("contShot");
			var pic=document.getElementById("picture");
			
			if(hasS.checked){
				if(hasE.checked){
					if(ss.checked){
						if(cs.checked){
							pic.src="test0.jpg";
						}else{
							pic.src="test1.jpg";
						}
					}else{
						if(cs.checked){
							pic.src="test2.jpg";
						}else{
							pic.src="test3.jpg";
						}
					}
				}else{
					if(ss.checked){
						if(cs.checked){
							pic.src="test6.jpg";
						}else{
							pic.src="test7.jpg";
						}
					}else{
						if(cs.checked){
							pic.src="test8.jpg";
						}else{
							pic.src="test9.jpg";
						}
					}
				}
			}else{
				if(hasE.checked){
					pic.src="test5.jpg";
				}else{
					pic.src="test10.jpg";
				}
			}
		}
		function checkName(){
			var name=document.getElementById("projectName").value;
			if(name=="" || name==null){
				alert("请输入项目名称");
				return ;
			}
			window.open("checkName.do?name="+name,"checkWin","top=120,left=350,scrollbars=yes,dialog=yes,modal=yes,width=300,height=230,resizable=yes");
		}
	</script>
  </head>
  
  <body onLoad="showImg();setHasEsp();setHasScence();">
  	<form action="initProjectShot.do" method="post">
  	<table border="0" cellpadding="0" cellspacing="0">
   	<tr>
   		<td id="btleftbian"><bean:message key="project.name"/>：</td>
	    <td id="rightcenter"><input id="projectName" type="text" name="projectName"><input type="button" value='<bean:message key="check"/> &nbsp;<bean:message key="name"/>' onClick="checkName();"></td>
   	</tr>
	<tr>
   		<td id="btleftbian"><bean:message key="project.shortname"/>：</td>
	    <td id="rightcenter"><input id="projectShortName" type="text" name="projectShortName" onChange="toName();"></td>
	</tr>
	<tr>
		<td id="btleftbian"><bean:message key="project.createtime"/>
		：　		</td>
	    <td id="rightcenter"><input type="text" name="beginDate" readonly="true"  onClick="showcalendar(event, this)"></td>
	</tr>
	<tr>
		<td id="btleftbian"><bean:message key="project.planfinishtime"/>：</td>
	    <td id="rightcenter"><input type="text" name="finishDate" readonly="true"  onClick="showcalendar(event, this)"></td>
	</tr>
	<tr>
		<td id="tdtop" colspan="2">&nbsp;</td>
	    
	</tr>
	</table>
	<table width="757" height="131" cellpadding="0" cellspacing="0" border="0">
		<tr>
			<td id="btleftbian">&nbsp;</td><td id="btcenterbian"><bean:message key="totalepisode"/></td><td id="btcenterbian"><bean:message key="totalscene"/></td><td id="btrightbian"><bean:message key="totalshot"/></td>
		</tr>
		<tr>
			<td id="leftcenter"><bean:message key="contains"/></td>
			<td id="leftcenter"><input type="checkbox" name="hasEspCheck" id="hasEspCheck" onClick="setHasEsp();" checked><bean:message key="contains.episode"/></td>
			<td id="leftcenter"><input type="checkbox" name="hasScenceCheck" id="hasScenceCheck" onClick="setHasScence();" checked><bean:message key="contains.scene"/></td>
			<td id="rightcenter">&nbsp;</td>
		</tr>
		<tr>
			<td id="leftcenter"><bean:message key="name"/></td>
			<td id="leftcenter"><input id="espName" name ="espName" type="text" onBlur="toName();"> <span style="color:#FF0000">Ex: _EP000</span></td>
			<td id="leftcenter"><input id="scenceName" name="scenceName" type="text" onBlur="toName();"> <span style="color:#FF0000">Ex: _SC000</span></td>
			<td id="rightcenter"><input id="shotName" name="shotName"  type="text" onBlur="toName();"> <span style="color:#FF0000">Ex: _Shot000</span></td>
			
		</tr>
		<tr>
			<td id="leftcenter">&nbsp;
			</td>
			<td colspan="3" id="rightcenter"><input id="allName" name="allName"  type="text" SIZE="100%" readonly onBlur="toName();" onFocus="toName();"></td>
		</tr>
		<tr>
			<td id="leftbottom"><bean:message key="directory"/></td>
			<td id="leftbottom">&nbsp;</td>
			<td id="leftbottom"><bean:message key="separateshotsbyscene"/><input type="checkbox" id="singleShot" name="singleShot" checked onClick="showImg();"></td>
			<td id="rightbottom"><bean:message key="continuousshotnumbers"/><input type="checkbox" id="contShot" name="contShot" checked onClick="showImg();"></td>
		</tr>
	</table>
	<table>
		<tr>
			<td><bean:message key="directorypic"/><IMG id="picture" ></td>
		</tr>
	</table>
	<input type="hidden" value="" name="espResult" id="espResult">
	<input type="hidden" value="" name="scenceResult" id="scenceResult">
	<input type="hidden" value="" name="shotResult" id="shotResult">
	
   <iframe name="ESPform" id="ESPform" src="ESPform.jsp" width="100%" height="100%" scrollbar="auto" frameborder="0"></iframe>
	
	</form>
	
  </body>
</html>
